﻿using Common.Device.Enums;
using Common.View.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Automation.Text;

namespace Common.Device.ViewModels
{
    public class TongXinViewModel : BindableBase
    {
        private int menuIndex = 0;
        /// <summary>
        /// 菜单索引
        /// </summary>
        public int MenuIndex
        {
            get { return menuIndex; }
            set { SetProperty(ref menuIndex, value); }
        }
        private bool isNewLine = false;
        /// <summary>
        /// 是否发送换行符
        /// </summary>
        public bool IsNewLine
        {
            get { return isNewLine; }
            set { SetProperty(ref isNewLine, value); }
        }
        private bool isRegex = false;
        /// <summary>
        /// 是否正则匹配
        /// </summary>
        public bool IsRegex
        {
            get { return isRegex; }
            set { SetProperty(ref isRegex, value); }
        }
        public List<string> DataTypes { get; set; } = Enum.GetNames(typeof(TongXinEnum.DataType)).ToList();

        private string dataType = TongXinEnum.DataType.ASCII.ToString();
        /// <summary>
        /// 数据类型
        /// </summary>
        public string DataType
        {
            get { return dataType; } 
            set { SetProperty(ref dataType, value); }
        }
        private string sendStr;
        /// <summary>
        /// 发送内容
        /// </summary>
        public string SendStr
        {
            get { return sendStr; }
            set { SetProperty(ref sendStr, value); }
        }
        private int waitTime;
        /// <summary>
        /// 等待时间
        /// </summary>
        public int WaitTime
        {
            get { return waitTime; }
            set { SetProperty(ref waitTime, value); }
        }
        private string receiveStr;
        /// <summary>
        /// 接收内容
        /// </summary>
        public string ReceiveStr
        {
            get { return receiveStr; }
            set { SetProperty(ref receiveStr, value); }
        }
    }
}
